# coding=utf-8
from PIL import Image
from pylab import *
from scipy.ndimage import measurements,filters
from numpy import *


#读取图像到数组中
im = array(Image.open('car.jpg'))
im = im.flat[:]
im1 = array(Image.open('test.png'))
im1 = im1.flat[:]
print(im)
print(im1)
if im1 in im:
    print("ok")
#im2 = zeros(im.shape)
#for i in range(3):
#    im2[:,:,i] = filters.gaussian_filter(im[:,:,i],10) #高斯核卷积
#im2 = uint8(im2)

#imshow(im2)
#show()



#im = 1*(im<128)
#labels,nbr_objects = measurements.label(im)


#imshow(im)
#show()
#新建一个图像
#figure()
#不使用颜色信息
#gray()
#在原点的左上角显示轮廓图像
#contour(im,origin='image')
#axis('equal')
#axis('off')
#画直方图
#figure()
#hist(im.flatten(),128)
#show()

#im = array(Image.open('car.jpg'))
#imshow(im)
#print 'Please click 3 points'
#x = ginput(3)
#print 'you clickd:',x
#show()

#im2 = 255 - im # 对图像进行反向处理
#im3 = (100.0/255) * im + 100
#im4 = 255.0 * (im/255.0)**2
##imshow(im2)
#show()
#imshow(im3)
#show()
##imshow(im4)
#show()

#print int(im.min()),int(im.max())
#print int(im2.min()),int(im2.max())
#print int(im3.min()),int(im3.max())